<style scoped lang="scss">
	.xy-radio-group {
		display: flex;
		.radio {
			display: flex;
			width: 200upx;
            /deep/ .uni-radio-input {
                transform: scale(.8);
            }
            .title {
                line-height: 1.8;
            }
		}
	}
</style>
<template>
    <view>
		<radio-group class="xy-radio-group" @change="radioChange">
			<label class="radio" :key="key" v-for="(item,key) in list">
				<view>
					<radio :value="item.value" :checked="value === item.value ? true : false" />
				</view>
				<view class="title">{{item.title}}</view>
			</label>
		</radio-group>
    </view>
</template>
<script>
export default {
    name: 'XyRadioGroup',
    props: {
		value: {
            type: [String, Number],
            default: ''
        },
		list: {
            type: Array,
			default: []
		},
        inline: {
            type: Boolean,
            default: true
        }
    },
    data() {
        return {
        }
    },
    created: function () {
    },
    methods: {
        radioChange(evt){
			this.$emit('input', evt.target.value);
		}
    }
}
</script>
